package com.boot.security.server.service;

import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

@Service
public class ApiAccessCheckService {

	/**
	 * 根据用户唯一标识判断用户是否能访问接口
	 * @param userId
	 */
	public void checkAccess(String userId) {
		if(StringUtils.isBlank(userId)) {
			throw new RuntimeException("您无权访问此接口");
		}
		if(StringUtils.isNotBlank(userId) && !userId.equals("111111")) {
			throw new RuntimeException("您无权访问此接口");
		}
	}
}
